/*-*-C-*-
 * Drag-n-Drop support for the shell
 */

#include "resed.h"
#include "main.h"

#include "wimp.h"
#include "resformat.h"
#include "dragdrop.h"
#include "registry.h"

#include "class.h"
#include "document.h"


/*
 * This client function is required to complete the common drag-drop
 *  functionality.
 */

error * dragdrop_accept (int windowhandle, MessageDraggingPtr msg, int *claimref)
{
    void *closure;
    DocumentPtr doc;
    RegistryType type = registry_lookup_window (windowhandle, &closure);
    switch (type)
    {
    case Document:
        doc = (DocumentPtr) closure;
        if (!doc->internal)
            return document_claim_drag (doc, windowhandle, msg, claimref);
        break;
    }
    claimref = 0;
    return NULL;
}


